template.defaults.imports.CountdownTime = function (factEndDate) {
    var timestamp = (new Date()).valueOf();
    return factEndDate - timestamp;
};
 
    var params = {};
    params.start = 0;
    params.limit = 1000;
    /* global getCookie orderId visitUrl*/
    params.token = getCookie('token');
    $.get('/antique/api/userAddress/query_list', params, function (result) {
        /* global template */
        $("#contentTo").append(template('content', result.data));

        $(".address .item").click(function () {
            $(".address .item").removeClass("current");
            $(this).addClass("current");
        
           
        });

    });
  function choseAdree () {
    var id = $(".address .current").data('aid');
    if (id == ''){
        $.toast("地址不能为空", "cancel");
        return;
    }
    if (orderId == ''){
        $.toast("参数错误", "cancel");
        return;
    }
    $.post('/antique/api/mallOrder/user/order_update_detail', { id:orderId,token:getCookie('token'),receiveAddressId:id }, function (result) {
        if (result.code == 0) {
            visitUrl(document.referrer,true);
            $.toast("操作成功！");
        } else {
            $.toast(result.message, "cancel");
        }
    });
  }